using DapperExtensionsNew.Data;
using System.Linq;
using System.Threading.Tasks;

namespace DapperExtensionsNew
{
    public static class RepositoryExtensions
    {
        public static async Task<T> SelectFirstOrDefaultAsync<T>(this IRepository<T> repository, IQuery<T> query)
        {
            return (await repository.SelectAsync(query)).FirstOrDefault();
        }
    }
}
